home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 4 Database How-To
/
Visual Basic 4 Database - How-to (The Waite Group)(1995).iso
/
users.fr_
/
users.fr
Wrap
Text File
|
1995-05-07
|
2KB
|
107 lines
VERSION 4.00
Begin VB.Form frmUsers
Caption = "Form1"
ClientHeight = 3525
ClientLeft = 2355
ClientTop = 4260
ClientWidth = 4710
BeginProperty Font
name = "MS Sans Serif"
charset = 1
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 3930
Left = 2295
LinkTopic = "Form1"
ScaleHeight = 3525
ScaleWidth = 4710
Top = 3915
Width = 4830
Begin VB.CommandButton cmdRemoveUser
Caption = "&Remove User"
Default = -1 'True
Enabled = 0 'False
Height = 555
Left = 360
TabIndex = 2
Top = 2520
Width = 1755
End
Begin VB.CommandButton cmdClose
Cancel = -1 'True
Caption = "Cl&ose"
Height = 555
Left = 2400
TabIndex = 1
Top = 2520
Width = 1755
End
Begin VB.ListBox lstUsers
Appearance = 0 'Flat
Height = 1785
Left = 1080
Sorted = -1 'True
TabIndex = 0
Top = 360
Width = 2295
End
End
Attribute VB_Name = "frmUsers"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdRemoveUser_Click()
On Error GoTo RemoveError
DBEngine.Workspaces(0).Groups(Me.Tag).Users.Delete lstUsers.Text
FillUserList
Exit Sub
RemoveError:
MsgBox Err.Description
Exit Sub
End Sub
Private Sub Form_Activate()
On Error GoTo ActivateError
Me.Caption = "Users in Group " & Me.Tag
FillUserList
Exit Sub
ActivateError:
MsgBox Err.Description
Exit Sub
End Sub
Sub FillUserList()
Dim usr As User
lstUsers.Clear
For Each usr In DBEngine.Workspaces(0).Groups(Me.Tag).Users
lstUsers.AddItem usr.Name
Next
End Sub
Private Sub lstUsers_Click()
cmdRemoveUser.Enabled = IIf(lstUsers.ListIndex = -1, False, True)
End Sub